
  data(){
   return{
    cateGory:[],
    productData:[],
    id:0,
    currentPage:1
   }
  },
  activated(){
   this.getCategory(),
   this.goodChange(0)
  },
  methods:{
   async getCategory(){
    let {data: res} = await cateApi.getCategory();
    this.cateGory = res.category
   },
   async goodChange(id){
    this.id = id
    this.currentPage = 1
    if(this.id == 0){
     let {data: res} = await cateApi.getAllProduct({categoryID: [], currentPage: this.currentPage, pageSize: 15});
     this.productData = res.Product
    }else{
     let {data: res} = await cateApi.getProductByCategory({categoryID: [id], currentPage: this.currentPage, pageSize: 15});
     this.productData = res.Product
    }
   }
   
   
  }
 